from models.userModel import *


def checkInviteCode(inviteCode):
    return True


@db_session
def newUserWithInviteCode(inviteCode, Email, nickName, tel, passWord):
    user = getUserByEmail(Email)
    if checkInviteCode is True and user is not None:
        return True
    elif newUser(nickName, passWord, tel, Email) == 1:
        return False


@db_session
def newUserWithoutInviteCode(Email, nickName, tel, passWord):
    if checkUserByEmail(Email) and checkUserByTel(tel):
        return False
    else:
        return newUser(nickName, passWord, tel, Email)
